package middle.ground.utils;

import java.security.MessageDigest;

/**
 * Sha256工具类
 *
 * @author jrl
 */
public class Sha256Util{

	public static String sign(String data) {
		try {
			MessageDigest crypt = MessageDigest.getInstance("SHA-256");
			crypt.reset();
			crypt.update(data.getBytes("UTF-8"));
			return ByteUtil.getHexString(crypt.digest());
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
}
